﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SuraQR.Controller;
using System.Diagnostics;

namespace SuraQR.ServerForm
{
    public partial class QRCodeProcessHandle : Form
    {
        public QRCodeProcessHandle()
        {
            InitializeComponent();
        }

        private void QRCodeProcessHandle_Load(object sender, EventArgs e)
        {

        }

        public void setinitValue(int max)
        {
            lbl_max.Text = ""+ max;
        }

        public void updateProcess(int curr, string msg)
        {
            lbl_current.Text = "" + curr;
            lbl_stat.Text = msg;
        }

        public void disPlayError(string msg)
        {
            lbl_msg.Text = msg;
        }

        public void clearDisplay()
        {
            lbl_current.Text = "" ;
            lbl_stat.Text = "";
            lbl_msg.Text = "";
            lbl_max.Text = "";
        }

        private void btn_cancle_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("cancle btn");
            ServerRuntimeSingleton.Instance.QRcodeService.clearReadData();
        }

        private void QRCodeProcessHandle_FormClosed(object sender, FormClosedEventArgs e)
        {
            Debug.WriteLine("close | cancle");
            ServerRuntimeSingleton.Instance.QRcodeService.clearReadData();
        }
    }
}
